package com.yn.module.spider.utils.base;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import org.springframework.stereotype.Service;

import java.util.Map;

@Service
public abstract class DefaultDetailSpiderService<M extends BaseMapper<T>,T> extends BaseService<M,T> implements DetailSpiderService{

    @Override
    public void deleteCurrentData(Map<String, Object> delParams) {
        QueryWrapper<T> queryWrapper = new QueryWrapper<>();
        queryWrapper.eq("pid",queryMaxPid((String)delParams.get(DATA_VERSION)));
        queryWrapper.eq("data_ver",delParams.get(DATA_VERSION));
        this.remove(queryWrapper);
    }
}
